<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021/11/30
 * Time: 10:32
 */

namespace vendor\core;

require "person.php";


//### 2.4.4 继承
class student extends person
{
    private $class;
    public static $type;


//### 2.4.7 静态属性和方法
    public static function setType($type){
        student::$type=$type;
    }

    public function __construct($name, $age, $gender)
    {
        $this->class="1班";
        student::$type="学生";
//### 2.4.6 调用父类的构造方法和普通方法
        parent::__construct($name, $age, $gender);
    }

    public function eat()
    {
        parent::eat();
        echo "食堂 eat";
        echo "<br>";
    }


}